﻿@using PopForums.Controllers
@model PopForums.Models.UserEditPhoto

@{
	ViewBag.Title = PopForums.Resources.Account + " - " + PopForums.Resources.ManagePhotos;
    Layout = "~/Areas/PopForums/Views/Shared/PopForumsMaster.cshtml";
}

<div id="TopBreadcrumb" class="navAbsolute">
	<h1>@PopForums.Resources.Account - @PopForums.Resources.ManagePhotos</h1>
	<p>
		^ @Html.ActionLink(PopForums.Resources.Forums, "Index", ForumHomeController.Name, null, null) | 
		@Html.ActionLink(PopForums.Resources.EditYourProfile, "EditProfile", "Account") | 
	    @Html.ActionLink(PopForums.Resources.ChangeYourEmailPassword, "Security", "Account") |
        @Html.ActionLink(PopForums.Resources.ExternalLogins, "ExternalLogins", "Account")
	</p>
</div>

@using (Html.BeginForm("ManagePhotos", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) {

	<h2>@PopForums.Resources.Avatar</h2>
	<p>@PopForums.Resources.UploadNew: <input type="file" id="avatarFile" name="avatarFile" /></p>
	if (Model.AvatarID.HasValue) {
		<p>
			<img src="@Url.Action("Avatar", "Image", new {id = Model.AvatarID})" alt="Avatar image" /><br />
			@Html.CheckBoxFor(m => m.DeleteAvatar) <label for="DeleteAvatar">@PopForums.Resources.AvatarDelete</label>
		</p>
	}
		
	<h2>@PopForums.Resources.Photo</h2>
	<p>@PopForums.Resources.UploadNew: <input type="file" id="photoFile" name="photoFile" /></p>
	if (Model.ImageID.HasValue) {
		<p>
			<img src="@Url.Action("UserImage", "Image", new {id = Model.ImageID})" alt="User image" /><br />
			@Html.CheckBoxFor(m => m.DeleteImage) <label for="DeleteImage">@PopForums.Resources.PhotoDelete</label>
			@if (Model.IsImageApproved.HasValue && !Model.IsImageApproved.Value) {
				<br />@PopForums.Resources.PhotoNotApproved
			}
		</p>
	}

	<input type="submit" value="@PopForums.Resources.Save" />

}
